// 购物车相关API
import instance from '@/utils/request'

// 加入购物车
export const insertCartAPI = ({ skuId, count }) => {
    return instance({
      url: '/member/cart',
      method: 'POST',
      data: {
        skuId,
        count
      }
    })
  }

// 获取最新的购物车列表
export const getNewCartListAPI = () => {
return instance({
    url: '/member/cart'
})
}

// 删除购物车
export const delCartAPI = (ids) => {
    return instance({
      url: '/member/cart',
      method: 'DELETE',
      data: {
        ids
      }
    })
  }

// 合并本地购物车到服务器购物车 (skuId, selected, count)
export const mergeCartAPI = (data) => {
    return instance({
      url: '/member/cart/merge',
      method: 'POST',
      data
    })
  }